<template>
  <div class="loading-screen">
    <div class="loading" v-if="showIcon">
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
</template>

<script>
export default {
  name: "SysLoading",
  props: {
    showIcon: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {};
  },
};
</script>

<style lang="scss" scoped>
.loading-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

.loading span {
  display: inline-block;
  width: 8px;
  height: 100%;
  border-radius: 4px;
  background: lightgreen;
  animation: loadsaven 1.04s ease infinite;
}

@keyframes loadsaven {
  0%,
  100% {
    height: 40px;
    background: #0f87e4;
  }

  50% {
    height: 60px;
    margin-top: -20px;
    background: #626f7a;
  }
}

.loading span:nth-child(2) {
  animation-delay: 0.13s;
}

.loading span:nth-child(3) {
  animation-delay: 0.26s;
}

.loading span:nth-child(4) {
  animation-delay: 0.39s;
}

.loading span:nth-child(5) {
  animation-delay: 0.52s;
}
.loading span {
  margin: 0 3px;
}
</style>
